package com.ruoyi.project.module.packet.service;

import com.ruoyi.common.support.Convert;
import com.ruoyi.project.module.packet.domain.Packet;
import com.ruoyi.project.module.packet.mapper.PacketMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 母红包 服务层实现
 * 
 * @author ruoyi
 * @date 2018-08-04
 */
@Service
public class PacketServiceImpl implements IPacketService 
{
	@Autowired
	private PacketMapper packetMapper;

	/**
     * 查询母红包信息
     * 
     * @param redPacketId 母红包ID
     * @return 母红包信息
     */
    @Override
	public Packet selectPacketById(String redPacketId)
	{
	    return packetMapper.selectPacketById(redPacketId);
	}
	
	/**
     * 查询母红包列表
     * 
     * @param packet 母红包信息
     * @return 母红包集合
     */
	@Override
	public List<Packet> selectPacketList(Packet packet)
	{
	    return packetMapper.selectPacketList(packet);
	}
	
    /**
     * 新增母红包
     * 
     * @param packet 母红包信息
     * @return 结果
     */
	@Override
	public int insertPacket(Packet packet)
	{
	    return packetMapper.insertPacket(packet);
	}
	
	/**
     * 修改母红包
     * 
     * @param packet 母红包信息
     * @return 结果
     */
	@Override
	public int updatePacket(Packet packet)
	{
	    return packetMapper.updatePacket(packet);
	}

	/**
     * 删除母红包对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deletePacketByIds(String ids)
	{
		return packetMapper.deletePacketByIds(Convert.toStrArray(ids));
	}
	
}
